import hx.display.FPS;
import hx.display.Image;
import hx.assets.Assets;
import hx.display.Stage;

class GameStage extends Stage {
	override function onStageInit() {
		super.onStageInit();

		var fps = new FPS();
		this.topView.addChild(fps);

		var assets = new Assets();
		assets.loadBitmapData("assets/image.png");
		assets.onComplete(function(a) {
			// 加成完成
			trace("图像资源加载完成");
			var image = new Image(a.getBitmapData("image"));
			this.addChild(image);
			image.x = (this.stageWidth - image.width) / 2;
			image.y = (this.stageHeight - image.height) / 2;
		});
		assets.start();
	}
}
